package com.videoweb.model;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@TableName("chunk_info")
public class ChunkInfo {
    
    @TableId(type = IdType.AUTO)
    private Long id;
    
    @TableField("file_hash")
    private String fileHash;
    
    @TableField("chunk_index")
    private Integer chunkIndex;
    
    @TableField("chunk_size")
    private Integer chunkSize;
    
    @TableField("chunk_hash")
    private String chunkHash; // 分片的MD5校验
    
    @TableField("file_path")
    private String filePath; // 分片文件存储路径
    
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime uploadTime;
    
    // 构造函数
    public ChunkInfo() {}
    
    public ChunkInfo(String fileHash, Integer chunkIndex, Integer chunkSize, String filePath) {
        this.fileHash = fileHash;
        this.chunkIndex = chunkIndex;
        this.chunkSize = chunkSize;
        this.filePath = filePath;
    }
    
    // 手动添加getter和setter方法
    public Long getId() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    public String getFileHash() {
        return fileHash;
    }
    
    public void setFileHash(String fileHash) {
        this.fileHash = fileHash;
    }
    
    public Integer getChunkIndex() {
        return chunkIndex;
    }
    
    public void setChunkIndex(Integer chunkIndex) {
        this.chunkIndex = chunkIndex;
    }
    
    public Integer getChunkSize() {
        return chunkSize;
    }
    
    public void setChunkSize(Integer chunkSize) {
        this.chunkSize = chunkSize;
    }
    
    public String getChunkHash() {
        return chunkHash;
    }
    
    public void setChunkHash(String chunkHash) {
        this.chunkHash = chunkHash;
    }
    
    public String getFilePath() {
        return filePath;
    }
    
    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }
    
    public LocalDateTime getUploadTime() {
        return uploadTime;
    }
    
    public void setUploadTime(LocalDateTime uploadTime) {
        this.uploadTime = uploadTime;
    }
} 